package manager.service;

import manager.dao.ManagerDao;
import manager.dao.ManagerDaoImpl;
import manager.model.Manager;

import javax.servlet.http.HttpSession;

public class ManagerServiceImpl implements MamagerService{


    ManagerDao managerDao = new ManagerDaoImpl();
    @Override
    public boolean isLogin(String username, String password, HttpSession session) {
        Manager manager = managerDao.queryByUsernamePassword(username,password);
        if (manager != null) {
            session.setAttribute("manager",manager);
            return true;
        } else
            return false;
    }

    @Override
    public long findNewsNumber() {
        return managerDao.findNewsNumber();
    }

    @Override
    public long findUsersNumber() {
        return managerDao.findUsersNumber();
    }

    @Override
    public long findPinglunNumber() {
        return managerDao.findPinglunNumber();
    }
}
